<style>
  .page_limit{
    float:right;
    padding-bottom: 10px;
  }
</style>
<?php
    function showOrderPlanName($record)
    {
       $View = ClassRegistry::getObject("View");
      $html = $View->loaded['html'];
      $listing = $View->viewVars['listings'][$record['ListingPlan']['listing_id']];
      $title = $listing['Listing']['title'];
      if($listing['Listing']['status'] == Listing::PUBLISH)
      {
        $title = $html->link($title,$listing['Listing']['viewUrl']);
      }
      return $record['ListingPlan']['plan_info']['Plan']['title'].'<br />'.$title;
    }
	$this->pageTitle = __("My Orders");
	$index->paginateCounter = "";
    foreach($orders as &$order)
    {
      $order['Order']['created'] = $time->format("Y-m-d",$order['Order']['created']);
    }
    $index->setData($orders,'Order');
	$index->sortablefields(array("id","created","status"));
	$index->showFields(array(array("id"=>__("Order Id")),array("created"=>__("Created")),array('plan_name'=>__("Plan name")),array("Order.status"=>__("Payment Status"))));
	$index->addColumn("plan_name","showOrderPlanName");
    $index->setAction(__('View Invoice'),'/paid_listings/orders/invoice/:Order.id');
	echo $index->display();
?>